﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.BLL;
using Automobile.service.Model;
using Automobile.service.Common;
namespace Automobile.service.UI.Hander
{
    /// <summary>
    /// AddProduct 的摘要说明
    /// </summary>
    public class AddProduct : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            ProductBLL bll = new ProductBLL();
            context.Response.ContentType = "text/plain";
            Product p=new Product ();
            p.Product_Name = context.Request["Product_Name"];
            p.Product_Modelspe = context.Request["Product_Modelspe"];
            p.Product_Bprid = Convert.ToDecimal(context.Request["Product_Bprid"]);
            p.Product_Price =Convert.ToDecimal(context.Request["Product_Price"]);
            p.Product_Type_Id = Convert.ToInt32(context.Request["Product_Type_Id"]);
            p.Product_Barcode = context.Request["Product_Barcode"];
            p.Supplier_Id = Convert.ToInt32(context.Request["Supplier_Id"]);
            p.Product_Remark = context.Request["Product_Remark"];
            context.Response.Write(bll.AddProduct(p));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}